from DrissionPage import ChromiumPage
dp = ChromiumPage()
page = 1
while True:
    url = f'https://www.mobanwang.com/mb/ind/list_{page}.html'
    dp.get(url)
    for i in range(1, 31):
        print("第" + str(i) + "个")
        a = dp.ele(f'x:/html/body/div[2]/div/div[2]/div[2]/div/div[{i}]/div/a')
        a.click()
        a2 = dp.ele(f'x:/html/body/div[2]/div/div[2]/div[2]/div/div[{i}]/div/div[1]/a[1]')
        a2cfnt = a2.click.for_new_tab()
        a2cfnt.set.activate()
        a3 = a2cfnt.ele('x:/html/body/div[2]/div/div[2]/div/div[1]/a[2]')
        a3.click()
        a2cfnt.wait(11)
        a2cfnt.close()
    page += 1